package br.com.ordersys.web.client.modules.events;

import com.google.gwt.event.shared.GwtEvent;

public class BroadcastEvent extends GwtEvent<BroadcastEventHandler> {
	//http://stackoverflow.com/questions/6030202/how-to-use-the-gwt-eventbus
	private BroadcastMessage message;
	public static Type<BroadcastEventHandler> TYPE = new Type<BroadcastEventHandler>();

	public BroadcastEvent(BroadcastMessage message) {
		super();
		this.message = message;
	}

	@Override
	protected void dispatch(BroadcastEventHandler h) {
		h.onEvent(this);
	}

	@Override
	public com.google.gwt.event.shared.GwtEvent.Type<BroadcastEventHandler> getAssociatedType() {
		return TYPE;
	}

	public BroadcastMessage getMessage() {
		return message;
	}

}
